import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    component: () => import(/* webpackChunkName: "home" */ '../views/user/home/index')
  },
  {
    path: '/callback',
    component: () => import(/* webpackChunkName: "login" */ '../views/CallBack/CallBack')
  },
  {
    path: '/login',
    component: () => import(/* webpackChunkName: "login" */ '../views/login/index')
  },
  {
    path: '/user',
    name: 'user',
    component: () => import(/* webpackChunkName: "user" */ '../views/user/index')
  },
  {
    path: '/user/register',
    name: 'userRegister',
    component: () => import(/* webpackChunkName: "userRegister" */ '../views/user/register/index')
  },
  {
    path: '/user/exam',
    name: 'userExam',
    component: () => import(/* webpackChunkName: "userExam" */ '../views/user/exam/index')
  },
  {
    path: '/user/update:update_id',
    name: 'userUpdate',
    component: () => import(/* webpackChunkName: "userUpdate" */ '../views/user/update/index')
  },
  {
    path: '/org',
    name: 'org',
    component: () => import(/* webpackChunkName: "org" */ '../views/org/index'),
    children:[
      {
        path:'/',
        redirect:'/org/studentRegisterList'
      },
      {
        path:'/org/studentRegisterList',
        name:'studentRegisterList',
        component: () => import(/* webpackChunkName: "studentList" */ '../views/org/studentRegisterList/index.vue')
      },
      {
        path:'/org/orgList',
        name:'orgList',
        component: () => import(/* webpackChunkName: "studentList" */ '../views/org/orgList/index.vue')
      },
      {
        path:'/org/examTime',
        name:'examTime',
        component: () => import(/* webpackChunkName: "studentList" */ '../views/org/examTime/index.vue')
      },
      {
        path:'/org/studentScore',
        name:'studentScore',
        component: () => import(/* webpackChunkName: "studentList" */ '../views/org/studentScore/index.vue')
      }
    ]
  },
  {
    path: '/admin',
    name: 'admin',
    component: () => import(/* webpackChunkName: "admin" */ '../views/admin/index'),
    children:[
      {
        path:'/',
        redirect:'/admin/studentRegisterList'
      },
      {
        path:'/admin/studentRegisterList',
        name:'adminStudentRegisterList',
        component: () => import(/* webpackChunkName: "adminStudentRegisterList" */ '../views/admin/studentRegisterList/index.vue')
      },
      {
        path:'/admin/orgList',
        name:'adminOrgList',
        component: () => import(/* webpackChunkName: "adminOrgList" */ '../views/admin/orgList/index.vue')
      },
      {
        path:'/admin/examTime',
        name:'adminExamTime',
        component: () => import(/* webpackChunkName: "adminExamTime" */ '../views/admin/examTime/index.vue')
      },
      {
        path:'/admin/studentScore',
        name:'adminStudentScore',
        component: () => import(/* webpackChunkName: "adminStudentScore" */ '../views/admin/studentScore/index.vue')
      }
    ]
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
